readData(); //initiate first read without any delay so we don't get blank fields on load.  
//You can also call this from 'body onLoad', but I prefer to keep my javascript stuff in one file, for many reasons

function readData() {
   var cd=new Date();
	//curTime=getTime();
	//ajax GET request to load the data.xml into xmlcontents var
  $.get('data.xml', function(xmlcontents) 
  {

    //you can read jQuery docs to understand the syntax of the next line
    //but in summary you have a local object directly named localdynvar1 so you can access it using # prefix
    //.find() searches for an XML tag, which in our case are xml_tag1, xml_tag2
    $('#mydynvar1').html($(xmlcontents).find('xml_tag1').text());
    $('#mydynvar2').html($(xmlcontents).find('xml_tag2').text());
	$('#mydynvar3').html(cd.toTimeString());
	
    //obviouslly for large amounts of data or grouped/array format, you may want to use for...next here
    //to simplify the display and to shorten the amount of code used.  From here on, it's just programming techniques.
  });
  
  //don't use setInterval here without canceling the previous timer first.
  setTimeout("readData()", 1000); //you can use setTimeout or setInterval to read the contents of the XML again in, ie, 5 seconds
}
